package com.lagou.rocket.dao;

import com.lagou.rocket.pojo.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface ProductDao extends JpaRepository<Product, Integer> {

    @Modifying
    @Query(value = "UPDATE product SET num = ?2 WHERE id = ?1", nativeQuery = true)
    void updateProductNum(Integer id, Integer num);
}
